Repository navigation
Refactor IOUCurrencySelection class to use hooks - #20579
Conversation
|
@narefyev91 @youssef-lr One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Hey both, I'm struggling to figure out why this lint change is necessary. |
| </ScreenWrapper> | ||
| ); | ||
| } | ||
| }, [searchValue, currencyData, props.translate]); |
There was a problem hiding this comment.
Surely it's better to just pass props.translate rather than props?
There was a problem hiding this comment.
for sure - props.translate should be in deps
There was a problem hiding this comment.
@Julesssss We have similar case before , we fixed that by a partial props destructing , check full thread here https://expensify.slack.com/archives/C01GTK53T8Q/p1684969645381109
There was a problem hiding this comment.
Thanks. I've read up on prop destructuring, is this how it's supposed to be done?
const { translate } = props;
There was a problem hiding this comment.
|
I think I have successfully merged the updates to a single |
| ], | ||
| headerMessage: isEmpty ? translate('common.noResultsFound') : '', | ||
| }; | ||
| }, [props.currencyList, searchValue, selectedCurrencyCode, translate]); |
There was a problem hiding this comment.
maybe we can also add currencyList at line 78?
Reviewer Checklist
Screenshots/VideosWebweb2.movweb1.movMobile Web - Chromeandroid-web2.movandroid-web1.movMobile Web - Safariios-web2.movios-web1.movDesktopdesktop-2.movdesktop-1.moviOSios-2.movios-1.movAndroidandroid-2.movandroid-1.mov |
|
Thanks both. All yours @youssef-lr |
|
Bumping for final review @youssef-lr |
# Conflicts: # src/pages/iou/IOUCurrencySelection.js
|
Hi @fedirjh, I forgot about this one and had to resolve a conflict. Would you mind one final review of the changes since you last approved please? |
|
@youssef-lr is OOO, so I will reassign once this is ready for internal review. |
fedirjh
left a comment
There was a problem hiding this comment.
LGTM and tests well.
cc @Julesssss
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #16274... Please reach out for help on Slack if no one gets assigned! |
|
Hey @srikarparsi, pullerbear is broken, but you won the reviewer lottery. Assigning you for the code review, C+ has already approved |
srikarparsi
left a comment
There was a problem hiding this comment.
code looks good to me!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.36-0 🚀
|
|
Haven't confirmed yet but it's looking like this caused #22130, I'll look into it and see if I can figure out a fix but wanted to ping early. |
| <> | ||
| <HeaderWithBackButton | ||
| title={translate('iOUCurrencySelection.selectCurrency')} | ||
| onBackButtonPress={() => Navigation.goBack(ROUTES.getIouRequestRoute(Navigation.getTopmostReportId()))} |
There was a problem hiding this comment.
ROUTES.getIouRequestRoute() doesn't currently exist which is causing the regression I commented on, will see if I can figure out what this is supposed to be and add it.
There was a problem hiding this comment.
@dangrous I think it should be :
onBackButtonPress={() => Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID))}There was a problem hiding this comment.
Yep! That's what I ended up going with - https://github.com/Expensify/App/pull/22135/files#diff-496700da68574808c5981ac4884e39d73ea02df4aa59bd5869e0c9227defe4c2R119 - it's weird, I looked through every commit in this PR and it never actually changed away from that in any of them. But it ends up being different in the end. I'm not sure how that happened
There was a problem hiding this comment.
I think maybe it's merging main into this branch, This PR was created while another PR that refactors the IOU modal is open, At some point the other PR was merged with new code, and I think upon merging the main we didn’t accept the new changes.
There was a problem hiding this comment.
Thanks both, Yeah my first guess was the merge as I recall some conflicts. I must have missed one when resolving.
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.36-5 🚀
|
CC @marcaaron
Details
Simply refactors the IOUCurrencySelection file away from class and introduces hooks.
Fixed Issues
$ #16274
Tests
Request Money
Split Bill
Send Money
Offline tests
Request Money
Split Bill
Send Money
QA Steps
Request Money
Split Bill
Send Money
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android